package org.Array;

public class ArrayDemo1 {
    public static void main(String[] args) {
//        静态初始化数组
        int[] ages = new int[]{12,23,45};
        double[] scores = new double[]{29.3,45.9,23.4};
//        简化写法
        int[] ages2 = {12,23,13};
        double[] score2 = {20.3,98.4};

        for(int i = 0; i<ages2.length;i++){
            System.out.println(ages2[i]);
        }
        int[] saleMoney = {16,26,36,6,100};
        int sum = 0;
        for (int i = 0; i < saleMoney.length; i++) {
            sum += saleMoney[i];
        }
        System.out.println("总销售额为："+sum);
    }
}
